package com.csw.flink.sql

import java.sql.Timestamp

import org.apache.flink.table.functions.ScalarFunction

/**
  * 编写自定义函数
  *
  *
  * 函数方法的名称必须为  eval
  */
class UTC2Local extends ScalarFunction {

  def eval(s: Timestamp): Timestamp = {

    //将时间增加8小时
    val timestamp: Long = s.getTime + 28800000

    //返回时间戳
    new Timestamp(timestamp)
  }

}
